Skip to content
Laravel Packagev13.xMIT License1.2K+ downloadsAI Ready · Laravel Boost

Has Files: Files on your models in one declaration

Declare a cover image, an ordered gallery, an intro video or a mixed media list on any Eloquent model, then read and manage them as $product->file('gallery'). Files are checked by their content before the model is written, saved right after it, and processed by Laravel Uploader only when you ask. It is AI ready: php artisan boost:install teaches your coding agent the whole package through Laravel Boost.

$composer require pharaonic/laravel-has-files

Compatibility

Each line is released for the versions in its row, read from that release's composer.json. Pick the line that matches your project; a combination not listed isn't supported. Find the right line of every package for your project.

LineLatest releasePHPLaravelStatusDocs
v13.xv13.0.0 Nov 29, 20268.3 – 8.513Current Docs: Read the v13.x docs
v12.xv12.0.0 Nov 29, 20268.2 – 8.512Maintained Docs: Read the v12.x docs
v11.xv11.0.0 Nov 29, 20268.2 – 8.411MaintainedLaravel 11 no longer gets security fixes Docs: Read the v11.x docs
v10.xv10.0.0 Nov 29, 20268.1 – 8.310MaintainedLaravel 10 no longer gets security fixes Docs: Read the v10.x docs
v9.xv9.0.0 Nov 29, 20268.0 – 8.29MaintainedLaravel 9 no longer gets security fixes Docs: Read the v9.x docs
v8.xv8.0.0 Nov 29, 20268.0 – 8.18MaintainedLaravel 8 no longer gets security fixes Docs: Read the v8.x docs
v7.xv7.0.0 Nov 29, 20268.07MaintainedLaravel 7 no longer gets security fixes Docs: Read the v7.x docs
v6.xv6.0.0 Nov 29, 20268.06MaintainedLaravel 6 no longer gets security fixes Docs: Read the v6.x docs

Maintenance

Latest release
v13.0.0
Nov 29, 2026 (11 hours ago)
Released lines
8
documented lines with a release; see compatibility
CI on develop
Tests passed
latest run Nov 29, 2026

From the package's releases and its GitHub Actions. A passing run means the test suite passed on develop, on every PHP version it supports; it isn't a security review, and each release line has its own runs on GitHub. Checked hourly.

A quick look

Declare the fileables once, then save and manage files through the model.

app/Models/Product.php
1public function fileables(): array
2{
3 return [
4 File::make('cover')->images()->thumbnail(width: 400),
5 File::make('gallery')->images()->multiple()->maxFiles(20)->convert('webp'),
6 ];
7}
8 
9$product = Product::create(['name' => 'Laptop', 'cover' => $cover, 'gallery' => $photos]);
10 
11$product->file('cover')->url;
12$product->file('gallery')->add($photo, position: 1);
13$product->file('gallery')->active()->get();
Key Features

Everything a model needs for its files

One fileables() method declares them; handlers do the rest.

Typed Fileables

images(), videos(), audios(), documents(), archives() and mixed(), each with only its own settings.

Ordered Lists

multiple() fileables keep positions from 1, with add() at a position, moves and reorder().

Saved With the Model

Give files to create() or update(): they are checked before the model is written and stored right after it.

Activation and Metadata

disable() a file without deleting it, and keep alt text or captions with setMeta().

Processing on Request

Thumbnails, resizing, WebP conversion and FFmpeg video processing, only when a definition asks.

Safe by Design

Types checked from content, owner-row locks for concurrent writes, and shared uploads never deleted while in use.

AI Ready

Ships a Laravel Boost guideline and a has-files-development skill, so php artisan boost:install teaches Claude Code, Cursor, Codex or Copilot the whole API.

FAQ

Has Files Questions

Quick answers about installing and using Has Files.

What is Has Files?

Attach images, videos, audio, documents and other files to Eloquent models, with typed declarations, ordering, activation, metadata and processing through Laravel Uploader. It's a free, open-source Laravel package by Pharaonic.

How do I install Has Files?

Run composer require pharaonic/laravel-has-files in your project's root directory, then php artisan migrate.

What does Has Files require?

The latest release requires PHP 8.3 – 8.5 and Laravel 13. FFmpeg is needed only for video and audio processing.

Does it replace Has Images?

Yes. Images are a fileable type now: declare them with images().

Are thumbnails made automatically?

No. Files are stored as they are uploaded. Call thumbnail() on a definition to make thumbnails, and the other processing methods for resizing, conversion or compression.

Can one upload belong to several models?

Yes. Attach an existing Upload to as many models as you like; each attachment has its own position, activation and metadata, and the upload is never deleted while one of them uses it.

Is Has Files free to use?

Yes. Has Files is open source under the MIT license, so you can use it in personal and commercial projects.

Where can I find the Has Files documentation?

Read the Has Files documentation for setup, configuration, and usage examples.

How do I report a bug or contribute to Has Files?

Open an issue or a pull request on GitHub, ask in GitHub Discussions, or chat with us on Discord.

Ready to dig in?

Read the full documentation for installation, definitions, processing, saving with models, ordering, activation, metadata, events and real-world examples.